package com.lastproject.ejb.dao;

import java.util.List;

import javax.ejb.Remote;

import com.lastproject.dto.UserDTO;

@Remote
public interface UserDAORemote {
	
	void create(UserDTO userDTO);
	UserDTO findById(int id);
	List<UserDTO> findByMultipleId(List<Integer> ids);
	List<UserDTO> getAll();
	void edit(UserDTO userDTO);
	void remove(UserDTO userDTO);
	UserDTO findCreatorUserBySurvey(int idSurvey);
	boolean existentUsername(String username);
	boolean existentWorkemail(String workEmail);
	
	
	/**
	 * User login method
	 * 
	 * @param logUsername
	 *            username provided by user in GUI
	 * @param logPassword
	 *            password provided by user in GUI
	 * @return user type if credentials are valid, invalid otherwise
	 */
	UserDTO userLogin(String logUsername, String logPassword);
	
	/**
	 * Change password of a user
	 * 
	 * @param logUsername
	 *            username
	 * @param passToChange
	 *            password that was generated automatically when a 
	 *            change password request was made by a user
	 * @param newPassword
	 *            new password provided by the user
	 * @return userDTO object
	 */
	UserDTO changePassword(String logUsername, String passToChange, String newPassword);
	
	/**
	 * When a password change request was sent for a given email address 
	 * reset the password associated with that account 
	 * change the password status to "newPassword" 
	 * send an email to the email address with details of how to change the password
	 * 
	 * @param providedEmail
	 * @return true if success, false otherwise
	 */
	boolean requestChangePassword(String providedEmail);
	
	UserDTO getLibrarian();
	
	
}
